Repository navigation
fix(provider): stage an update only as the version it is signed as - #2117
Merged
Merged
Conversation
`latestRelease` takes the release `version` from the coordinator's JSON, and `checkForUpdate` judges no-downgrade eligibility by it. Staging verified the bundle, binary and metallib hashes and the pinned code signature, but never compared that label with the version the app is signed as, and the recovery record then carried the label. Whoever controls the release response could offer an older, genuinely signed build under a newer version and have it installed. After the deep signature check (and the runtime capability check), staging now requires the app's sealed `CFBundleShortVersionString` to equal the release's `version` exactly, under every policy that verifies signatures (production and the signed test fixture). Release builds set that key to the registered version, which the coordinator requires to be bare semver, so an exact string comparison is the contract. `signedVersion(ofApp:)` becomes static so staging can use the same reader as recovery. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refactor-pass follow-up. Read the sealed version right after the deep signature check, before `verifyRuntimeCapabilities` runs any staged code, so a mislabelled release is refused without running its smoke test on every Mac each update cycle. Accept and refuse are unchanged for every input; only which error is reported changes when several checks fail. Test and changelog wording now say exactly what they show. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rsion-matches-release Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rsion-matches-release Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 14, 2026
jonathan308
added a commit
that referenced
this pull request
Nov 14, 2026
- changelog.d/gemma-tool-grammar-linear-optional-members.md: generic public text (#2111) - changelog.d/updater-signed-version-matches-release.md: generic public text (#2117) - changelog.d/cluster-pairing-posture-is-self-reported.md: generic public text (#2129) - changelog.d/inbound-json-depth-and-tool-schema-budget.md: generic public text (#2130) - changelog.d/coordinator-inbound-queue-budget.md: generic public text (#2135) - changelog.d/toml-parse-memory.md: generic public text (#2138) - changelog.d/cluster-link-key-keychain.md: generic public text (#2137) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A security scan (finding 252) reported that coordinator metadata can mislabel a signed downgrade. Confirmed on
dev:SelfUpdater.latestReleasetakes the releaseversionfrom the coordinator's JSON, andcheckForUpdatejudges no-downgrade eligibility by it.mlx.metallibhashes and the pinned code signature, but never compared that label with the version the app is signed as. The recovery record then carried the label (UpdateInstallLayout.recordForStagedBundle).The attacker still needs control of the release response and can only choose among old signed builds, so the impact is bounded, but the check is cheap and closes it.
Change
After the deep code-signature check, staging reads the app's sealed
CFBundleShortVersionString(UpdateRecoveryStore.signedVersion(ofApp:), nowstatic) and refuses the bundle unless it equals the release'sversionexactly. It runs beforeverifyRuntimeCapabilities, so a mislabelled bundle never runs its runtime smoke, and before the staged tree hash that commit re-verifies. It applies under every policy that verifies signatures (production and the signed test fixture), and every install path (darkbloom update, auto-update, the cluster pair cycle, the watchdog) goes through this one staging function.Release builds already set
CFBundleShortVersionStringto the registeredVERSION, and CI asserts it (scripts/provider-signing-validation.py); the coordinator requires bare semver. So exact string equality is the contract; prerelease labels (-dev.branch.N,-staging.N) compare as signed.Before
flowchart LR classDef bad fill:#fde2e1,stroke:#c0392b,color:#1b1b1b classDef ok fill:#e3f4e1,stroke:#2e7d32,color:#1b1b1b classDef io fill:#e6eefc,stroke:#2f5fb3,color:#1b1b1b C["/v1/releases/latest<br/>version: 99.0.0"]:::io --> E{"99.0.0 newer<br/>than installed?"}:::bad E -- yes --> D["download, bundle hash"]:::ok D --> S["code signature (pinned)"]:::ok S --> R["runtime smoke"]:::ok R --> I["install app signed as 0.10.11<br/>recorded as 99.0.0"]:::badAfter
flowchart LR classDef ok fill:#e3f4e1,stroke:#2e7d32,color:#1b1b1b classDef io fill:#e6eefc,stroke:#2f5fb3,color:#1b1b1b classDef stop fill:#fff4d6,stroke:#b7791f,color:#1b1b1b C["/v1/releases/latest<br/>version: 99.0.0"]:::io --> E{"newer?"}:::ok E -- yes --> D["download, bundle hash"]:::ok D --> S["code signature (pinned)"]:::ok S --> V{"sealed CFBundleShortVersionString<br/>== release version?"}:::ok V -- no --> X["refused before any staged code runs"]:::stop V -- yes --> R["runtime smoke"]:::ok R --> I["install"]:::okValidation
signedVersionMustMatchReleaseondev's staging code0.10.13-dev.branch.7still stages as that releaseSelfUpdaterTests(2 suites, incl. the real signed-fixture verification and fan-helper cases)make docs-check,make docs-impact-check BASE=upstream/dev,make changelog-checkTests ran on an M3 Ultra with
DARKBLOOM_RELEASE_ENVIRONMENT=prod, as CI builds them.Limitations
scripts/install.sh(fresh installs) has no equivalent check; it has no no-downgrade rule to bypass and writes no update record, so a mismatch there only changes the version it prints.Security stack
This strengthens update verification; encryption, attestation and weight-hash code are untouched. Signature verification is unchanged and still runs first.
Refactor pass
An independent refactor pass found no correctness bug and no install path that skips the check or legitimately installs a different signed version. It moved the check ahead of the runtime smoke (so a mislabelled bundle runs no staged code) and tightened test and changelog wording (second commit).
🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.